/*
  ANCMedia v.3
  Author: Suzuki_aka
  Pm: suzuki_aka , meoit, es.utehy@gmail.com 
*/
var $_=function(e){return document.getElementById(e)};
String.prototype.GetPart=function(e){e=this.substr(this.indexOf("#")+1).match(RegExp("(^|&)"+e+"=([^&]*)(&|$)"));return null!=e?unescape(e[2]):null}; 
function ANCMedia(){
	w=anc.gackiem.width;
	h=anc.gackiem.height;
	logo=anc.gackiem.logo;
	proxy=anc.gackiem.proxy;
	player=anc.gackiem.player;
	sk=anc.gackiem.skin;
	position=anc.gackiem.position;
	margin=anc.gackiem.margin;
	dl=anc.id.data;
	pl=anc.id.pl;
	tp=anc.id.tp;
	playing=anc.id.playing;
	home=anc.you.home;
	ver="ANCMedia 3.0.3";
	author="Suzuki_aka";
	m_data=$_(dl).innerHTML;
	r_left='<div  id="r_data" style="display:none !important;" title="Data here  !">';
	r_right="</div>";
	m_data=m_data.replace(/\[id\]/gi,r_left);
	m_data= m_data.replace(/\[\/id\]/gi,r_right);
	m_data=m_data.replace(/\<id\>/gi,r_left);
	m_data=m_data.replace(/\<\/id\>/gi,r_right);
	m_data=m_data.replace(/\<mp\>/gi,r_left);
	m_data=m_data.replace(/\<\/mp\>/gi,r_right);
	m_data=m_data.replace(/\<\!\-\-/gi,r_left);
	m_data=m_data.replace(/\-\-\>/gi,r_right);
	$_(dl).innerHTML=m_data;
	
	data=m_data=$_("r_data").innerHTML;
	//-1!=m_data.indexOf("phimxi*")?(m_data=$_("r_data").innerHTML,m_data=m_data.replace(/phimxi\*/gi,""),m_data=$.md5(m_data)):m_data=$_("r_data").innerHTML;
	//data=m_data;
	
	l_spi=data.split("|").length;
	l_spk=function(d){return data.split("|")[d].split(";").length};
	d_spi=function(d){return data.split("|")[d]};
	d_spk=function(d, f){return data.split("|")[d].split(";")[f]};
	part=[];
	pc="0,a,b,c,d,e,f,g,h,i,k,l,m,n,o,p,q,r,s".split(",");
	ab="";part_ep="";data_out="";
  css="<style>/*\n\t"+ver+";\n\tAuthor: "+author+";\n\tWebsite: http://MaPhim.Net;\n*/\n#anc_tp{border:  2px solid green; width: 627px;}#anc_tp td{border: 1px solid  red;}td.svs{width:15%!important;  padding:4px;}td.eps{width:85%!important; padding:4px;}td.eps a{padding-left:6px}td.eps  li{font-size: 15px;height: 35px;line-height: 30px;padding-left: 10px;text-align: justify;width: 89px;margin:2px; float: left!important; list-style:none;background:#000000}.clear{clear:both!important;}</style>";
	document.write(css);	
	this.Play=function(){
		for(var  d=0;d<sv.length;d++)part[d]='<tr class="sv_rows"  id="'+sv[d]+'"><td class="svs"><span  class="'+sv[d].replace(/\./gi,"_")+'">Server '+sv[d]+'</span></td><td class="eps">';
		for(var f=0;f<l_spi;f++){name_ep=d_spk(f,0);
		for(var e=0;e<l_spk(f);e++)
        if(link_ep=d_spk(f,e),number_ep=Number(d_spk(f,0)),number_epp="",0<f&&(number_epp=Number(d_spk(f-1,0))),2==l_spk(f)?part_ep=ab="":(ab=pc[e],part_ep="-"+e),number_ep?name_eppart=name_ep+ab:name_eppart=name_ep+part_ep,""!=d_spk(f,e))for(d= 0;d<sv.length;d++)-1!=d_spk(f,e).indexOf(sv[d])&&(part[d]+='<li><a  rel="'+ver+" - "+home+":"+name_eppart+'" title="Xem Tập : '+name_eppart+'" href="#p='+f+"/"+e+"/"+name_eppart.replace(/ /gi,"_")+'" onclick="M.Load(\''+link_ep+"','"+name_eppart+"');\">"+name_eppart.substr(0,9)+"</a></li><\!--ANCMedia Part--\>")}data_out+="<table>";if(2<=l_spi)for(d=0;d<sv.length;d++)-1!=part[d].indexOf("ANCMedia")&&(data_out+=part[d]+"<div  id='"+d+"' class='clear' /></td></td>");
		else  data_out+='<tr class="sv_rows" id="Full_'+ home+'"><td class="svs"><span class="home">Server  '+home+'</span></td><td class="eps"><li><a  rel="'+ver+" - "+home+': Xem \u0111\u1ea7y \u0111\u1ee7" title="Xem  \u0111\u1ea7y \u0111\u1ee7 - '+ver+'"  href="javascript:M.Load(\''+data+'\',\'Full_time\');">Xem  \u0111\u1ea7y \u0111\u1ee7</a></li><div id="home"  class="clear"  /></td></td>';
		data_out+="</table>";
		$_(tp).innerHTML=data_out};
		
	this.Load=function(d,f){obj="";name_ep="";-1!=d.indexOf(sv[0])&&(d=d.match(/\b\?[\W\w]*/gi),obj=e(d)[1]);-1!=d.indexOf(sv[1])&& (d=d.replace(/\/nghe\?L\=/gi,"/l/"),obj=e(d)[2]);-1!=d.indexOf(sv[2])&&1>=d.indexOf(sv[6])&&(obj=e(d)[3]);-1!=d.indexOf(sv[3])&&(d=d.replace(/\.anc/gi,".flv"),obj=e(d)[3]);-1!=d.indexOf(sv[4])&&(d=d.replace(/anc\.yl/gi,"http://gdata.youtube.com/feeds/api/playlists"),obj=e(d)[0]);-1!=d.indexOf(sv[5])&&(d=d.replace(/videos/gi,"embed"),d=d+"?w="+w+"&h="+h+"",obj=e(d)[4]);-1!=d.indexOf(sv[6])&&(obj=e(d)[5]);for(var g=6;g<sv.length;g++)-1!=d.indexOf(sv[g])&&(obj=e(d)[0]);Number(f)?name_ep="\u0110ang xem t\u1eadp: "+ f+"":5<=f.length?name_ep="\u0110ang xem: "+f+"":!Number(f)&&5>f.length&&(name_ep="\u0110ang xem ph\u1ea7n: "+f+"");$_(pl).innerHTML=obj;$_(playing).innerHTML=name_ep};
	
	/*
	var e=function(d){
		_mode='allowfullscreen="true" allowscriptaccess="always" width="'+w+'" height="'+h+'" autostart="true" type="application/x-shockwave-flash"';
		_add="autostart=true&amp;skin="+sk+'" src="'+player+"?logo.file="+logo+"&amp;logo.hide=false&amp;logo.position="+position+"&amp;logo.margin="+margin+'"';
		return obj=['<embed id="player" flashvars="plugins='+ proxy+"&proxy.link="+d+"&amp;"+_add+" "+_mode+" />",
		'<embed id="player" src=http://video.google.com/googleplayer.swf'+d+"&hl=vi&fs=true  "+_mode+"> </embed>",
		'<embed id="player" '+_mode+' src=  "'+d+'" ></embed>',
		'<embed id="player"  flashvars="file='+d+"&amp;"+_add+" "+_mode+" />",
		'<iframe  id="player" src="'+d+'" '+_mode+' frameborder="0"  scrolling="no"></iframe>',
		"<embed "+_mode+'  pluginspage="http://www.macromedia.com/go/getflashplayer"  src="'+d+'"/>']};
	*/
	lgo="http://dl.dropbox.com/u/52283085/123.png";
	var e=function(d){
	_mode='allowfullscreen="true" allowscriptaccess="always" width="'+w+'" height="'+h+'" autostart="true" type="application/x-shockwave-flash"';
	_add="autostart=true&amp;skin="+sk+'" src="'+player+"?lgo.file="+lgo+"&amp;lgo.hide=false&amp;lgo.position="+position+"&amp;lgo.margin="+margin+'"';
	return obj=[
		'<embed id="player" flashvars="plugins='+proxy+"&proxy.link="+d+"&amp;"+_add+" "+_mode+" />",
		'<embed id="player" src=http://video.google.com/googleplayer.swf'+d+"&hl=vi&fs=true "+_mode+"> </embed>",
		'<embed id="player" '+_mode+' src= "'+d+'" ></embed>',
		'<embed id="player" flashvars="file='+d+"&amp;"+_add+" "+_mode+" />",
		'<iframe style="width:'+w+"; height:"+h+';" id="player" src="'+d+'" '+_mode+' frameborder="0" scrolling="no"></iframe>',
		"<embed "+_mode+' pluginspage="http://www.macromedia.com/go/getflashplayer"  src="'+d+'"/>',
		'<embed id="player" src="http://tinh.in/phimonline/playermegafun.swf" flashvars="autostart=true&amp;file='+d+"&amp;streamer=http://ctl.vsolutions.vn/ctl/video/?bts=MaPhim.Net&amp;backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x557722&lgo="+lgo+'&image=" '+_mode+"/>",
		'<embed width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" src="http://phimvang.org/player/player.swf?logo.file=http://phimvang.org/img/logo-trans.png&amp;logo.hide=false&amp;logo.position=top-right&amp;logo.margin=-1010&amp;skin=http://phimvang.org/player/plugins/skin_full.swf" flashvars="plugins=http://phimvang.org/player/plugins/ListBox.swf,http://phimvang.org/player/plugins/proxy.swf&amp;proxy.list='+d+'&amp;autostart=true">',
		'<a href="'+d+'" title="Xem ph\u1ea7n ti\u1ebfp theo"><img src="http://dl.dropbox.com/u/52283085/c.jpg" alt="Ph\u1ea7n ti\u1ebfp theo !"></img></a>',
		'<iframe style="width:'+w+"; height:"+h+';" id="player" src="http://play.maphim.net'+d+'" '+_mode+' frameborder="0" scrolling="no"></iframe>',
		"<iframe "+_mode+' src="'+d+'?&fs=1&rel=1&autoplay=1&loop=0&egm=0&border=0&showsearch=0&showinfo=0&iv_load_policy=0&cc_load_policy=1&disablekb=1" frameborder="0" ></iframe>',
		'<iframe src="'+d+'" frameborder="0" scrolling="no" '+_mode+" allowfullscreen></iframe>",
		'<script src="http://player.ooyala.com/player.js?embedCode='+d+"&width=660&height="+h+'"><\/script>',
		'<embed allownetworking="internal" allowscriptaccess="none" src="http://xemphim.pro.vn/wp-content/plugins/music/asset/newtubedark/flvplayer.swf" flashvars="file='+d+'&amp;image=http://dl.dropbox.com/u/52283085/c.png&amp;skin=&amp;logo=&amp;logo.hide=http://dl.dropbox.com/u/52283085/123.pngfalse&amp;logo.position=top-left&amp;controlbar.position=bottom&amp;autostart=true" '+_mode+">"]};		
		this.Qstr=function(){str=window.location.href; part=str.GetPart("p");null==part&&(part="0/1/"+d_spk(0,0)+"");a=part.split("/")[0];b=part.split("/")[1];c=decodeURI(part.split("/")[2]);2<=l_spi?this.Load(d_spk(a,b),c):this.Load(data,"Full_time")}}M=new ANCMedia;M.Play();M.Qstr();
	
		function decode64(d){var e="",m,l,n="",o,p="",i=0,d=d.replace(/[^A-Za-z0-9\+\/\=]/g,"");do m=keyStr.indexOf(d.charAt(i++)),l=keyStr.indexOf(d.charAt(i++)),o=keyStr.indexOf(d.charAt(i++)),p=keyStr.indexOf(d.charAt(i++)),m=m<<2|l>>4,l=(l&15)<<4|o>>2,n=(o&3)<<6|p,e+=String.fromCharCode(m),64!=o&&(e+=String.fromCharCode(l)),64!=p&&(e+=String.fromCharCode(n));while(i<d.length);return unescape(e)}
	